package com.lby.rabbitmq.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @ClassName RabbitMqConfig
 * @Description TODO
 * @Author louby0923
 * @Date 2024/2/1 17:25
 * @Version 1.0
 */
@Component
public class RabbitMqConfig {
    @Bean
    public Queue simpleQueue() {
        return new Queue("simple.queue");
    }

    @Bean
    public Queue objectQueue() {
        return new Queue("object.queue");
    }

    /* @Bean
     public MessageConverter customMessageConverter() {
         return new CustomMessageConverter();
     }*/
    @Bean
    public MessageConverter messageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}
